import { RequestConfig } from "@/utils/request";

export type FileMetaType = {
  id: string;
  fileKey: string;
  fileName: string;
  fileSize: number;
  fileType: string;
  fileParseStatus?: number;
  fileUrl: string;
  fileJson?: string;
  createTime?: string;
  updateTime?: string;
  rowKey?: string;
  source?: 'upload' | 'cloud';
  fileContent?: string;
};

export type cloudFilePdf2txtObtainUrlType = {
  fileKey: string;
  fileUrl: string;
  fileName: string;
  fileSize: number;
  fileType: string;
  id: string;
  fileJson: string;
};


export type OnTransferProgressType = (progress: number, loaded: number, total?: number) => void;

export type TransferFileOptions = {
  onProgress?: OnTransferProgressType;
  signal?: AbortSignal;
} & RequestConfig;

export type UploadImageOptions = TransferFileOptions & {
  maxSizeMB?: number;
  maxWidthOrHeight?: number;
  isPublic?: boolean;
};
